fn main() {
    println!("Hello, world!");
    // 创建枚举值

    let four= IpAddrKind::V4(127,0,0,1);
    let six= IpAddrKind::V6(String::from("::1"));

    route(four);
    route(six);
    //route(IpAddrKind::V6);

    let some_number = Some(5);
    let some_String = Some("5");
    let absent_number:Option<i32>=None;

    let x:i8 = 5;
    let y:Option<i8> = Some(5);
    // let sum = x+y // 错误
    
    let c = Coin::Quarter(UsState::Alaska);
    println!("{}",value_in_cents(c));
}
enum Coin {
    Penny,
    Nickel,
    Dime,
    Quarter(UsState)
}
fn value_in_cents(coin:Coin)->u8{
    match coin {
        Coin::Penny =>{
            println!("Penny");
            1
        },
        Coin::Nickel =>5,
        Coin::Dime => 10,
        Coin::Quarter(state) => {
            println!("state quarter from {:?}!",state);
            25
        },
    }
}
struct IpAddr{
    kind:IpAddrKind,
    address:String,
}
enum IpAddrKind{
    V4(u8,u8,u8,u8),V6(String),
}
fn route(ip_kind:IpAddrKind){

}
#[derive(Debug)]
enum UsState {
    Alabama,Alaska,
}
